<template>
  <div class="container">
    <div class="is-size-4 mb-5 has-text-weight-bold">
      <span class="primary-color">丨</span>错题集
    </div>

    <!-- 筛选 -->
    <span class="mx-5">科目</span>
    <el-select v-model="selectedSubject" placeholder="请选择">
      <el-option
        v-for="item in subjectList"
        :key="item"
        :label="item"
        :value="item"
      />
    </el-select>

    <!-- 筛选 -->
    <el-radio-group v-model="qType" class="mx-5">
      <el-radio label="all">全部</el-radio>
      <el-radio label="single">单选题</el-radio>
      <el-radio label="multiple">多选题</el-radio>
    </el-radio-group>

    <!-- 错题列表 -->
    <div v-for="(item, index) in qList" :key="index" class="my-5 mx-5">
      <question-item
        :qid="item.id"
        :index="index + 1"
        :subject="item.subject"
        mode="review"
        :type="item.type"
        :correct="item.correct"
        :question="item.question"
        :choices="item.choices"
      />
    </div>
  </div>
</template>

<script>
import qList from '@/temp/questionList'
import QuestionItem from '@/components/QuestionItem.vue'

export default {
  components: {
    QuestionItem
  },
  data() {
    return {
      qType: 'all',
      subjectList: ['语文', '数学', '英语', '政治'],
      selectedSubject: '',
      qList: qList.concat(qList).concat(qList)
    }
  },
  computed: {},
  methods: {}
}
</script>

<style lang="scss" scoped>
.container {
  margin-bottom: 100px;
}
</style>
